/**
 * 
 */
package com.net.web.controllers;

import javax.servlet.ServletException;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.SimpleFormController;

import com.net.domain.Student;
import com.net.service.StudentService;

/**
 * @author Dinesh
 *
 */
public class StudentUpdateController extends SimpleFormController {
	
	private StudentService studentService;
	
	@Override
	protected ModelAndView onSubmit(Object command) throws ServletException {
		ModelAndView mav = new ModelAndView(getSuccessView());
		
		Student student = (Student)command;
		
		studentService.updateStudentInfo(student);
		
		return mav;		
	}

	public StudentService getStudentService() {
		return studentService;
	}

	@Autowired
	public void setStudentService(StudentService studentService) {
		this.studentService = studentService;
	}

}
